cmake_minimum_required (VERSION 2.6)
project (SiuRenderLab)
# The version number.
set (SiuRenderLab_VERSION_MAJOR 1)
set (SiuRenderLab_VERSION_MINOR 0)

MESSAGE ("This is build for windows, use dynamic lib")
set(CoreLinkType SHARED)

#add_definitions(-DUNICODE -D_UNICODE)
 
# add the binary tree to the search path for include files
include_directories("${PROJECT_BINARY_DIR}")
 
# add the global inlude dir
include_directories ("${PROJECT_SOURCE_DIR}/Src/Engine/SiuCommon/Interface")
include_directories ("${PROJECT_SOURCE_DIR}/Src/Engine/SiuCommon/Math")
include_directories ("${PROJECT_SOURCE_DIR}/Src/Engine/SiuCommon")

# add SiuLauncher
FILE(GLOB sources ./Src/Engine/SiuLauncher/*.cpp)
add_executable(SiuLauncher ${sources})
target_link_libraries(SiuLauncher 
)

# add SiuRendererD3D9
FILE(GLOB sources ./Src/Engine/SiuRendererD3D9/*.cpp ./Src/Engine/SiuRendererD3D9/*/*.cpp ./Src/Engine/SiuRendererD3D9/*.h ./Src/Engine/SiuRendererD3D9/*/*.h ./Src/Engine/SiuRendererD3D9/*/*/*.h)
add_library(SiuRendererD3D9 ${CoreLinkType} ${sources})
target_include_directories(SiuRendererD3D9 PRIVATE
    Src/Engine/SiuRendererD3D9/
    Src/Engine/SiuRendererD3D9/include/
    Src/Engine/SiuRendererD3D9/GameScene/
    Src/Engine/SiuRendererD3D9/GameScene/include/
    Src/ThirdParty/DXSDK/include
    Src/Engine/SiuRendererD3D9/DXUT/
    Src/Engine/SiuRendererD3D9/RenderRes/

)
target_link_libraries(SiuRendererD3D9 
    winmm.lib
    comctl32.lib
    ${PROJECT_SOURCE_DIR}/Src/ThirdParty/DXSDK/lib/x64/d3d9.lib
    ${PROJECT_SOURCE_DIR}/Src/ThirdParty/DXSDK/lib/x64/dxerr.lib
    ${PROJECT_SOURCE_DIR}/Src/ThirdParty/DXSDK/lib/x64/dxguid.lib
    ${PROJECT_SOURCE_DIR}/Src/ThirdParty/DXSDK/lib/x64/d3dx9.lib
    ${PROJECT_SOURCE_DIR}/Src/ThirdParty/DXSDK/lib/x64/d3dx10.lib
)

# add SiuRendererD3D11
FILE(GLOB sources ./Src/Engine/SiuRendererD3D11/*.cpp ./Src/Engine/SiuRendererD3D11/*/*.cpp ./Src/Engine/SiuRendererD3D11/*.h ./Src/Engine/SiuRendererD3D11/*/*.h ./Src/Engine/SiuRendererD3D11/*/*/*.h)
add_library(SiuRendererD3D11 ${CoreLinkType} ${sources})
target_compile_definitions(SiuRendererD3D11 PRIVATE 
	-DUNICODE
	-D_UNICODE
)
target_include_directories(SiuRendererD3D11 PRIVATE
    Src/Engine/SiuRendererD3D11/
    Src/Engine/SiuRendererD3D11/include/
	Src/ThirdParty/DXSDK/include
)
target_link_libraries(SiuRendererD3D11 
    winmm.lib
    comctl32.lib
    ${PROJECT_SOURCE_DIR}/Src/ThirdParty/DXSDK/lib/x64/d3d11.lib
    ${PROJECT_SOURCE_DIR}/Src/ThirdParty/DXSDK/lib/x64/d3dx11.lib
    ${PROJECT_SOURCE_DIR}/Src/ThirdParty/DXSDK/lib/x64/dxgi.lib
)

# add SiuRendererD3D11_Self
FILE(GLOB sources ./Src/Engine/SiuRendererD3D11_Self/*.cpp ./Src/Engine/SiuRendererD3D11_Self/*/*.cpp ./Src/Engine/SiuRendererD3D11_Self/*.h ./Src/Engine/SiuRendererD3D11_Self/*/*.h ./Src/Engine/SiuRendererD3D11_Self/*/*/*.h)
add_library(SiuRendererD3D11_Self ${CoreLinkType} ${sources})
target_compile_definitions(SiuRendererD3D11_Self PRIVATE 
	-DUNICODE
	-D_UNICODE
)
target_include_directories(SiuRendererD3D11_Self PRIVATE
    Src/Engine/SiuRendererD3D11_Self/
    Src/Engine/SiuRendererD3D11_Self/include/
	Src/ThirdParty/DXSDK/include
)
target_link_libraries(SiuRendererD3D11_Self 
    winmm.lib
    comctl32.lib
    ${PROJECT_SOURCE_DIR}/Src/ThirdParty/DXSDK/lib/x64/d3d11.lib
    ${PROJECT_SOURCE_DIR}/Src/ThirdParty/DXSDK/lib/x64/d3dx11.lib
    ${PROJECT_SOURCE_DIR}/Src/ThirdParty/DXSDK/lib/x64/dxgi.lib
)


# add SiuRendererPTR
FILE(GLOB sources ./Src/Engine/SiuRendererPTR/*.cpp ./Src/Engine/SiuRendererPTR/*/*.cpp ./Src/Engine/SiuRendererPTR/*.h ./Src/Engine/SiuRendererPTR/*/*.h ./Src/Engine/SiuRendererPTR/*/*/*.h)
add_library(SiuRendererPTR ${CoreLinkType} ${sources})
target_include_directories(SiuRendererPTR PRIVATE
    Src/Engine/SiuRendererPTR/
    Src/Engine/SiuRendererPTR/include/
    Src/Engine/SiuRendererPTR/PatherTracer/
    Src/Engine/SiuRendererPTR/PatherTracer/include/
    Src/Engine/SiuRendererPTR/PatherTracer/Chapter/
    Src/Engine/SiuRendererPTR/PatherTracer/*
    Src/Engine/SiuRendererPTR/PatherTracer/*/*
)
target_link_libraries(SiuRendererD3D9 
    winmm.lib
    comctl32.lib
)